package com.vancouver.knows.business.tracker;

import com.pangu.task.IResultReceiver;
import com.pangu.task.OperateResult;
import com.vancouver.knows.business.BusinessModule;

import java.util.HashMap;

/**
 * Created by Chris Li on 2016-07-13.
 */
public class FetchUserPostCategoriesTracker extends ABInvokeTracker {

    public FetchUserPostCategoriesTracker(BusinessModule module, IResultReceiver resultReceiver) {
        super(module, resultReceiver);
    }

    @Override
    public String TAG() {
        return FetchUserPostCategoriesTracker.class.getSimpleName();
    }

    @Override
    public void handleResult(OperateResult result) {
        HashMap<String, Object> map = (HashMap<String, Object>) result.getResultData();
        if (map == null){
            return;
        }

        module.getCacheManager().setUserPostCategories(map);
    }
}
